package com.ewing.busi.carry.dao;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.ewing.busi.carry.model.WebCarryWay;
import com.ewing.core.jdbc.BaseDao;

/**
 * 
 * @author tanson lam
 * @create Aug 27, 2016
 * 
 */
@Repository("carryWayDao")
public class CarryWayDao {
	@Resource
	private BaseDao baseDao;

	public int deleteByTemplateId(Integer templateId) {
		return baseDao
				.executeSql("delete from web_carry_way where carry_template_id="
						+ templateId);
	}

	public List<WebCarryWay> findByTemplateId(Integer templateId) {
		String queryString = "carry_template_id=" + templateId;
		return baseDao.find(queryString, WebCarryWay.class);
	}
}
